<!--
 * Tencent is pleased to support the open source community by making Tars available.
 *
 * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * https://opensource.org/licenses/BSD-3-Clause
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap_datepicker.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/bootstrap_datepicker.min.js"></script>
    <script src="../js/template.js"></script>
    <script src="../js/common.js"></script>
</head>
<body>
<div class="content">
    <h4 class="sub-header">授权管理</h4>
    <div class="form-horizontal">
        <div class="form-group">
            <!--<div class="col-sm-1"><label class="tr wp100 control-label">开始时间 </label></div>-->
            <!--<div class="col-sm-2">-->
                <!--<input type="text" class="form-control date" id="from">-->
            <!--</div>-->
            <!--<div class="col-sm-1"><label class="tr wp100 control-label">结束时间 </label></div>-->
            <!--<div class="col-sm-2">-->
                <!--<input type="text" class="form-control date" id="to">-->
            <!--</div>-->
            <div class="col-sm-1"><button type="button" class="btn btn-primary" id="btn-add-token">新增token</button></div>
        </div>
    </div>
    <div id="token-list" class="mt10"></div>
</div>


<div id="dlg-ret" style="display:none">

</div>



<script type="text/html" id="token-tpl">
    <table class="table table-bordered" id="token-table">
        <thead>
        <tr>
            <th>servant名</th>
            <th>主调服务</th>
            <th>token</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{each data as it}}
            {{if it.m_tokens}}
                {{each it.m_tokens as token obj}}
                    <tr class="normal-tr">
                        <td>{{it.s_obj_name}}</td>
                        <td>{{obj}}</td>
                        <td>{{token}}</td>
                        <td><a href="javascript:void(0);" onclick="deleteToken('{{it.s_obj_name}}', '{{obj}}')">解除授权</a></td>
                    </tr>
                {{/each}}
            {{/if}}
        {{/each}}
        </tbody>
        <tfoot>
            <tr><td class="tpage" colspan="4"></td></tr>
        </tfoot>
    </table>
</script>


<div id="dlg-add-token" class="form-horizontal" style="display: none;">
    <div class="form-group">
        <div class="col-sm-2"><label class="tr wp100 control-label">servant名</label></div>
        <div class="col-sm-9">
            <select type="text" class="form-control" id="a-obj-name"></select>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-2"><label class="tr wp100 control-label">主调服务 </label></div>
        <div class="col-sm-9">
            <input type="text" class="form-control" id="a-application-server-name">
        </div>
    </div>
</div>


<script src="../js/token_list.js"></script>
</body>
</html>
